﻿<%@ Page Language="c#" CodeBehind="DisplayDocument.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.DocumentFlowPages.DisplayDocumentPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>SignDocument</title>
  <uds:Style runat="server" Href="~/css/BasicLayout.css" />
  <uds:CommonJScript runat="server" ExcludeJQuery="true" ExcludeJQueryUI="true" />
  <style type="text/css">
    .titleColumn { background-color: #e8f4ff; }
    .headerRow td { padding-top: 6px; padding-bottom: 6px; background-color: #e8f4ff; }
  </style>
  <script type="text/javascript">
  //<!--
  function on_back() {
    var numList = parseInt('<%= docPathList.Items.Count %>', 10);
    if (numList > 1) {
      $('#<%= panelMain.ClientID %>').hide();
      $('#<%= panelDocPath.ClientID %>').show();
      document.getElementById("<%= cmdBack.ClientID %>").focus();
    } else {
      // directly submit the button
      var btn = document.getElementById("<%= cmdBack.ClientID %>");
      btn.click();
    }
    return false;
  }

  function close_dialog() {
    $('#<%= panelDocPath.ClientID %>').hide();
    $('#<%= panelMain.ClientID %>').show();
  }
  //-->  
  </script>
</head>
<body>
  <form runat="server" id="aspNetForm">
  <div class="commonBg" style="height: 28px; line-height: 28px; vertical-align: middle; text-align: center;">
    基本信息
  </div>
  <table class="fixedTable borderTable" style="width: 100%;">
    <colgroup>
      <col style="width: 20%;" />
      <col style="width: 80%;" />
    </colgroup>
    <tr>
      <td class="titleColumn right">流程</td>
      <td><%= HttpUtility.HtmlEncode(CurrentDoc.FlowName) %> </td>
    </tr>
    <tr>
      <td class="titleColumn right">发送者</td>
      <td><%= HttpUtility.HtmlEncode(CurrentDoc.CreatorRealName) %> </td>
    </tr>
    <tr>
      <td class="titleColumn right">发送日期</td>
      <td><%= Utility.FormatDate(CurrentDoc.TimeCreated) %> </td>
    </tr>
    <tr>
      <td class="titleColumn right">当前步骤</td>
      <td><a href="DisplayTacheMember.aspx?DocID=<%= CurrentDoc.DocID %>&ReturnPage=<%= ReturnPage %>"><%= HttpUtility.HtmlEncode(CurrentDoc.StepName) %> </a></td>
    </tr>
  </table>
  <div class="commonBg" style="height: 28px; line-height: 28px; vertical-align: middle; text-align: center;">
    详细表单
  </div>
  <table class="fixedTable borderTable" style="width: 100%;">
    <colgroup>
      <col style="width: 20%;" />
      <col style="width: 80%;" />
    </colgroup>
    <asp:Repeater runat="server" ID="fieldRepeater">
      <ItemTemplate>
        <tr>
          <td class="titleColumn right"><%# HttpUtility.HtmlEncode(((FlowStyleDescription)Container.DataItem).Description) %> </td>
          <td><%# HttpUtility.HtmlEncode( CurrentDoc.Data[((FlowStyleDescription)Container.DataItem).Name]) %> </td>
        </tr>
      </ItemTemplate>
    </asp:Repeater>
    <asp:Repeater runat="server" ID="attachmentRepeater">
      <ItemTemplate>
        <tr>
          <td class="titleColumn right">附件 </td>
          <td>
            <asp:HyperLink runat="server" Text="<%# ((DocumentFile)Container.DataItem).FileName %>" NavigateUrl="<%# Utility.CombineVirtualDirs(((DocumentFile)Container.DataItem).FileVisualPath, ((DocumentFile)Container.DataItem).FileName)  %>" />
          </td>
        </tr>
      </ItemTemplate>
    </asp:Repeater>
  </table>
  <asp:Repeater runat="server" ID="postilRepeater">
    <HeaderTemplate>
      <div class="commonBg" style="height: 28px; line-height: 28px; vertical-align: middle; text-align: center;">
        历史审批意见
      </div>
      <table class="fixedTable borderTable" style="width: 100%;">
        <colgroup>
          <col style="width: 100px;" />
          <col style="width: 150px;" />
          <col style="width: 100px;" />
          <col style="width: 70%;" />
          <col style="width: 30%;" />
          <col style="width: 100px;" />
        </colgroup>
        <tr class="headerRow">
          <td>批阅人</td>
          <td>批阅时间</td>
          <td>批阅类型</td>
          <td>批阅内容</td>
          <td>附件</td>
          <td>用时（分）</td>
        </tr>
    </HeaderTemplate>
    <ItemTemplate>
      <tr>
        <td><%# HttpUtility.HtmlEncode( ((DocumentPostil)Container.DataItem).Author ) %></td>
        <td><%# Utility.FormatDateTime( ((DocumentPostil)Container.DataItem).TimeCreated ) %></td>
        <td><%# Utility.GetEnumDisplayName( ((DocumentPostil)Container.DataItem).Type ) %></td>
        <td><%# HttpUtility.HtmlEncode(((DocumentPostil)Container.DataItem).Content) %></td>
        <td><%# FormatPostilAttachmentLink((DocumentPostil)Container.DataItem)%></td>
        <td><%# ((DocumentPostil)Container.DataItem).TimeConsumed %></td>
      </tr>
    </ItemTemplate>
    <FooterTemplate>
      </table>
    </FooterTemplate>
  </asp:Repeater>
  <asp:PlaceHolder runat="server" ID="placeHolderPostil">
    <div class="commonBg" style="height: 28px; line-height: 28px; vertical-align: middle; text-align: center;">
      审批意见
    </div>
    <table class="fixedTable borderTable" style="width: 100%;">
      <colgroup>
        <col style="width: 20%;" />
        <col style="width: 100%;" />
      </colgroup>
      <tr runat="server" id="projectRow" visible="false">
        <td class="titleColumn right">请选择所属项目</td>
        <td>
          <asp:DropDownList runat="server" ID="ddlProject" CssClass="Input3" />
        </td>
      </tr>
      <tr>
        <td class="titleColumn right">审批内容 </td>
        <td>
          <asp:TextBox runat="server" ID="txtPostil" TextMode="MultiLine" Width="70%" Rows="10" />
        </td>
      </tr>
      <tr id="attachmentRow">
        <td class="titleColumn right">上传附件</td>
        <td>
          <asp:FileUpload runat="server" ID="fileUpload" CssClass="longInput" />
        </td>
      </tr>
    </table>
  </asp:PlaceHolder>
  <asp:Panel runat="server" ID="panelMain">
    <table class="fixedTable borderTable" style="width: 100%;">
      <colgroup>
        <col style="width: 20%;" />
        <col style="width: 100%;" />
      </colgroup>
      <tr>
        <td>&nbsp;</td>
        <td>
          <asp:Button ID="cmdSignIn" runat="server" CssClass="redbuttoncss optionbutton" Text="签收" EnableViewState="False" />
          <asp:Button ID="cmdPostilNext" runat="server" CssClass="redbuttoncss optionbutton" Text="同意" EnableViewState="False" />
          <asp:Button runat="server" ID="cmdBack_selector" CssClass="redbuttoncss optionbutton" Text="回退" OnClientClick="on_back();return false;" />
          <asp:Button ID="cmdPostilFaile" runat="server" CssClass="redbuttoncss optionbutton" Text="拒绝" EnableViewState="False" />
          <asp:Button ID="cmdPostilFinish" runat="server" CssClass="redbuttoncss optionbutton" Text="完成" EnableViewState="False" />
          <asp:Button ID="cmdCancelSignIn" runat="server" CssClass="redbuttoncss optionbutton" Text="取消签收" EnableViewState="False" />
          <uds:RedirectButton ID="cmdReturn" runat="server" CssClass="redbuttoncss optionbutton" Text="返回" CausesValidation="False" EnableViewState="False" />
        </td>
      </tr>
    </table>
  </asp:Panel>
  <asp:Panel runat="server" ID="panelDocPath" Style="display: none;">
    <table class="fixedTable borderTable" style="width: 100%;">
      <colgroup>
        <col style="width: 20%;" />
        <col style="width: 100%;" />
      </colgroup>
      <tr>
        <td>&nbsp;</td>
        <td>
          <p>
            请选择要回退到的环节：
          </p>
          <p>
            <asp:RadioButtonList runat="server" ID="docPathList" RepeatLayout="Flow" />
          </p>
          <p>
            <asp:Button runat="server" ID="cmdBack" Text="回退" class="redbuttoncss optionbutton" />
            <input type="button" value="取消" onclick="close_dialog()" class="redbuttoncss optionbutton" />
          </p>
        </td>
      </tr>
    </table>
  </asp:Panel>
  </form>
</body>
</html>
